from beartype import beartype

@beartype
def greet(name: str) -> str:
    return f"Hello, {name}!"

greet("World")  # 正常执行
greet(123)      # 触发TypeError异常
